package org.janon.httpproxy.client;

import org.janon.httpproxy.Log;

public class ClientLauncher
{
	public static void main(String[] args)
	{
		String host = "janon.vicp.net";
		int port = 80;
		boolean needLog = false;
		if(args.length>=1)
		{
			try
			{
				String[] arg = args[0].split(":");
				if(arg.length==2)
				{
					host = arg[0];
					port = Integer.parseInt(arg[1]);
				}
				if(args.length>=2){
					if(args[1].equalsIgnoreCase("-log"))
					{
						needLog = true;
					}
				}
			}
			catch(Exception e)
			{
				host = "janon.vicp.net";
				port = 80;
			}
		}
		Log.getInstance().setRecordToFile(needLog);
		Client client = new Client(host,port);
		new Thread(client).start();
	}
}
